package de.cbf.cam.dsa.person.views;


import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;

import de.cbf.cam.dsa.person.base.CompositePersonBaseDSA;

/**
 * view for a person containing all composites
 * 
 * @author Alti
 *  
 */
public class PersonView extends ViewPart {

	/**
	 * The ID of the view as specified by the extension.
	 */
	public static final String ID = "de.cbf.cam.dsa.person.views.PersonView";
	private CompositePersonBaseDSA cmpPersonBase;


	/**
	 * The constructor.
	 */
	public PersonView() {
	}

	/**
	 * This is a callback that will allow us
	 * to create the viewer and initialize it.
	 */
	public void createPartControl(Composite parent) {
		
		Composite main = new Composite(parent, SWT.NONE);
		GridLayout loMain = new GridLayout(1,false); 
		main.setLayout(loMain);
		main.setLayoutData(new GridData(GridData.FILL_BOTH));
		
		cmpPersonBase = new CompositePersonBaseDSA(main, SWT.NONE);
		GridData gdPersonBase = new GridData(SWT.FILL,SWT.TOP,true,false,1,1);
		cmpPersonBase.setLayoutData(gdPersonBase);
	}

	

	/**
	 * Passing the focus request to the viewer's control.
	 */
	public void setFocus() {
		cmpPersonBase.setFocus();
	}

	/**
	 * @return
	 */
	public CompositePersonBaseDSA getCompositePersonBase() {
		return cmpPersonBase;
	}
}